/**
* Created with CLion.
* User:Lenovo
* Date:2023-05-31
* Time:1:12
* Description:
*/
#ifndef AWA_HEAP_H
#define AWA_HEAP_H

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stdbool.h>

typedef int HPDataType;
typedef struct Heap
{
    HPDataType *a;
    int size;
    int capacity;
} HP;

void HeapInit(HP *pHp);
void HeapDestroy(HP *pHp);
void HeapPush(HP *pHp, HPDataType x);
void HeapPop(HP *pHp);
HPDataType HeapTop(HP *pHp);
bool HeapEmpty(HP *pHp);
int HeapSize(HP *pHp);
void Swap(int *a, int *b);
void HeapSort(int *a, int n);
void AdjustDown(int *a, int n, int parent);

#endif //AWA_HEAP_H
